

#ifndef __MAP_H_
#define __MAP_H_

typedef struct
{
    int length;
    int sockfd;
    char *data;
} RecvData;

//记录结构_读者
typedef struct record
{
    int sockfd; //key
    RecvData *recvData;
} Record;

typedef struct mnode
{
    Record *record;
    struct mnode *next;
} MNode;

typedef struct map
{
    MNode *head;
    //Node *tail;
    //int size;
} Map;

/* 函数声明 */
void addToMap(Map *map, int sockfd, char *msg, int len);
MNode *getbykey(Map *map, int id);
void removebykey(Map *map, int id);
int isMapNull(Map *map);

#endif